<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Vidracaria</title>
        <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
        <script src="js/prototype.js" type="text/javascript"></script>
        <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
        <script src="js/lightbox.js" type="text/javascript"></script>
    </head>
    <body>
        <div class="total">
            <div class="menulogin">
                <?php
                include_once 'cabecalho.php';
                include_once 'titulo.php';
                include_once 'script/conecta.php';
                ?>
            </div>

            <div class="cabecalho">
            </div>
            <?php
                include_once 'menuHorizontal.php';
            ?>
                <div class="conteudo">
                    <div class="subconteudo">

                        <div class="espaçoGaleria">
                        <?php
                        conecta();
                        global $conexao;

                        if ($_GET['GALERIA']) {
                            $sql = "CALL sp_getImagens(" . $_GET['GALERIA'] . ")";
                            $resultado = mysql_query($sql) or die($sql . mysql_error($conexao));
                        ?>
                            <table>
                                <tr>
                                <?php
                                $i = 0;
                                while ($linha = mysql_fetch_array($resultado)) {
                                    $i++;
                                    echo "<td>";
                                    echo "<div class='imagens'>";
                                    
                                    echo "<td>";
                                    echo "<div class='imagens'>";
                                    echo "<a href='imagens/" . $linha['ima_caminho'] . "' rel='lightbox[roadtrip]' title='" .$linha['ima_nome'] ."'><img src='thumb.php?img=imagens/" .$linha['ima_caminho'] . "' title=''>";
                                    echo "</div>";
                                    echo "</td>";
                                    if ($i == 3) {
                                        echo "</tr><tr>";
                                        $i = 0;
                                    }
                                }
                                ?>
                        </table>


                        <?php
                            }
                            desconecta();
                        ?>

                        </div>
                    <?php
                            include_once 'menuVertical.php';
                    ?>
                        </div>
                        <div class="rodape">
                    <?php
                            include_once 'rodape.php';
                    ?>
                </div>
            </div>
        </div>
    </body>
</html>
